package view;

import Util.ActionContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class RedircView implements ViewResult {
    private String url;
    public RedircView(String url){
        this.url=url;
    }
    @Override
    public void execute() {
        HttpServletResponse response = ActionContext.getContext().getResponse();
        try {
            response.sendRedirect(url);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
